﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    { 
        public DataSet QueryVRPOS(DataRow dwData, int option = 1)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();

            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM VRPOS WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM VRPOS WHERE  "
                        + "  VRPMANDANT=:VRPMANDANT  AND VRPRENR=:VRPRENR";
                    or1.Parameters.Add("VRPMANDANT", OracleType.NVarChar).Value = dwData["VRPMANDANT"].ToString();
                    or1.Parameters.Add("VRPRENR", OracleType.NVarChar).Value = dwData["VRPRENR"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "VRPOS";
            }
            Return.Merge(Result);

            return Return;
        } 
     
    
    }
}
